//package com.changjiang.myproductsale.myproduct.servlet;
//
//import com.changjiang.myproductsale.myproduct.dao.impl.CategoryImpl;
//import com.changjiang.myproductsale.myproduct.entity.Category;
//
//import javax.servlet.*;
//import javax.servlet.http.*;
//import javax.servlet.annotation.*;
//import java.io.IOException;
//import java.util.List;
//
//@WebServlet(name = "ServletCategory", value = "/category")
//public class ServletCategory extends HttpServlet {
//    @Override
//    protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
//        // 创建CategoryImpl实例
//        CategoryImpl categoryDao = new CategoryImpl();
//        // 调用getAllCategories方法获取分类信息
//        List<Category> categories = categoryDao.getAllCategories();
//        // 将分类信息设置为请求属性
//        request.setAttribute("categories", categories);
//        // 转发请求到test.jsp页面
//        request.getRequestDispatcher("/index.jsp").forward(request, response);
//    }
//
//    @Override
//    protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
//        doGet(request, response);
//    }
//}